﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BattleThis.Core.Battle
{
	public class BattleContext
	{

		#region Variablen

		protected Map Map { get; set; }
		public Unit Attacker { get; protected set; }
		public Unit Defender { get; protected set; }
		public Field AttackPosition { get; protected set; }
		public Field DefencePosition { get; protected set; }

		#endregion

		#region Properties
		#endregion

		#region Methoden

		public BattleContext( Map map, Unit attacker, Unit defender )
		{
			if( map == null ) throw new ArgumentNullException( "map" );
			if( attacker == null ) throw new ArgumentNullException( "attacker" );
			if( defender == null ) throw new ArgumentNullException( "defender" );

			this.Map = map;
			this.Attacker = attacker;
			this.Defender = defender;

			this.AttackPosition = this.Map.Find( attacker );
			this.DefencePosition = this.Map.Find( defender );
		}

		#endregion

	}
}